<?php
	class Deal_detail extends CI_Controller
	{
		public function __construct()
		{
			parent::__construct();
			if (!isset($_SESSION)) {
			    session_start();
			    session_regenerate_id();
			}
			$this->load->helper("url");
			
		}
		public function index()
		{
			$data=array();
			$did=0;
			if(isset($_REQUEST['did']))
				$did=$_REQUEST['did'];
			$data['did']=$did;
			
			$this->load->model("mcategory");
			$data['list_category']=$this->mcategory->list_category();
			
			$this->load->model("mdeal");
			$data['list_deal_today']=$this->mdeal->list_deal_today();
			
			$data['deal_detail']=$this->mdeal->get_deal($did);	
			
			$data['action']="deal_detail";
			$this->load->view("main_template", $data);
		}
		
		
	}
?>